﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a02
    {
        private int? _propty;
		private string _proptyname;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 属性代码
        /// </summary>
		public int? Propty
		{
			get { return _propty;	 }
			set { _propty=value;	}
		}
        /// <summary>
        /// 属性名称
        /// </summary>
		public string Proptyname
		{
			get { return _proptyname;	 }
			set { _proptyname=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Pot0a02> GetPot0a02ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a02> list = new List<Pot0a02>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a02 model = GetPot0a02ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a02 GetPot0a02ByDataRow(DataRow dr)
		{
			Pot0a02 model = new Pot0a02(); //实例化Pot0a02
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("propty")&&!(dr["propty"] is System.DBNull))  
				model.Propty = ( int)dr["propty"];
			if (dcc.Contains("proptyname")&&!(dr["proptyname"] is System.DBNull))  
				model.Proptyname = ( string)dr["proptyname"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
